package com.dawn.module.hospital.model.pay.bill;

import lombok.Data;

import java.io.Serializable;
import java.util.Date;

/**
 * HIS账单表
 * @TableName t_bill_his
 */
@Data
public class BillHis  implements Serializable {

    private static final long serialVersionUID = -845387809168326017L;

    /**
     * 主键
     */
    private Long id;

    /**
     * 支付平台应用ID
     */
    private String payCenterAppId;

    /**
     * 支付平台商户号
     */
    private String payCenterMchNo;

    /**
     * 对账配置Id
     */
    private Long reconConfigId;

    /**
     * 账单日日期
     */
    private String billDate;

    /**
     * 患者姓名
     */
    private String patientName;

    /**
     * 患者ID
     */
    private String patientId;

    /**
     * 身份证号
     */
    private String idCardNo;

    /**
     * 患者门诊号
     */
    private String clinicNo;

    /**
     * HIS订单号
     */
    private String hisTradeNo;

    /**
     * 商户订单号（调用支付平台方订单号）
     */
    private String mchOrderNo;

    /**
     * 订单金额
     */
    private String totalFee;

    /**
     * 订单状态  支付订单：SUCCESS  退费订单：REFUND
     */
    private String tradeState;

    /**
     * 支付类型
     */
    private String tradeType;

    /**
     * 支付项目
     */
    private String tradeItem;

    /**
     * 业务类型(挂号/处方缴费/...")
     */
    private String feeType;

    /**
     * 是否退费
     */
    private String refund;

    /**
     * 退费金额
     */
    private String refundFee;

    /**
     * 交易时间
     */
    private String tradeTime;

    /**
     * 创建时间
     */
    private Date createdAt;

    /**
     * 更新时间
     */
    private Date updatedAt;

    /**
     * 备注
     */
    private String remark;


    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        BillHis other = (BillHis) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getPayCenterAppId() == null ? other.getPayCenterAppId() == null : this.getPayCenterAppId().equals(other.getPayCenterAppId()))
            && (this.getPayCenterMchNo() == null ? other.getPayCenterMchNo() == null : this.getPayCenterMchNo().equals(other.getPayCenterMchNo()))
            && (this.getReconConfigId() == null ? other.getReconConfigId() == null : this.getReconConfigId().equals(other.getReconConfigId()))
            && (this.getBillDate() == null ? other.getBillDate() == null : this.getBillDate().equals(other.getBillDate()))
            && (this.getPatientName() == null ? other.getPatientName() == null : this.getPatientName().equals(other.getPatientName()))
            && (this.getPatientId() == null ? other.getPatientId() == null : this.getPatientId().equals(other.getPatientId()))
            && (this.getIdCardNo() == null ? other.getIdCardNo() == null : this.getIdCardNo().equals(other.getIdCardNo()))
            && (this.getClinicNo() == null ? other.getClinicNo() == null : this.getClinicNo().equals(other.getClinicNo()))
            && (this.getHisTradeNo() == null ? other.getHisTradeNo() == null : this.getHisTradeNo().equals(other.getHisTradeNo()))
            && (this.getMchOrderNo() == null ? other.getMchOrderNo() == null : this.getMchOrderNo().equals(other.getMchOrderNo()))
            && (this.getTotalFee() == null ? other.getTotalFee() == null : this.getTotalFee().equals(other.getTotalFee()))
            && (this.getTradeState() == null ? other.getTradeState() == null : this.getTradeState().equals(other.getTradeState()))
            && (this.getTradeType() == null ? other.getTradeType() == null : this.getTradeType().equals(other.getTradeType()))
            && (this.getTradeItem() == null ? other.getTradeItem() == null : this.getTradeItem().equals(other.getTradeItem()))
            && (this.getFeeType() == null ? other.getFeeType() == null : this.getFeeType().equals(other.getFeeType()))
            && (this.getRefund() == null ? other.getRefund() == null : this.getRefund().equals(other.getRefund()))
            && (this.getRefundFee() == null ? other.getRefundFee() == null : this.getRefundFee().equals(other.getRefundFee()))
            && (this.getTradeTime() == null ? other.getTradeTime() == null : this.getTradeTime().equals(other.getTradeTime()))
            && (this.getCreatedAt() == null ? other.getCreatedAt() == null : this.getCreatedAt().equals(other.getCreatedAt()))
            && (this.getUpdatedAt() == null ? other.getUpdatedAt() == null : this.getUpdatedAt().equals(other.getUpdatedAt()))
            && (this.getRemark() == null ? other.getRemark() == null : this.getRemark().equals(other.getRemark()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getPayCenterAppId() == null) ? 0 : getPayCenterAppId().hashCode());
        result = prime * result + ((getPayCenterMchNo() == null) ? 0 : getPayCenterMchNo().hashCode());
        result = prime * result + ((getReconConfigId() == null) ? 0 : getReconConfigId().hashCode());
        result = prime * result + ((getBillDate() == null) ? 0 : getBillDate().hashCode());
        result = prime * result + ((getPatientName() == null) ? 0 : getPatientName().hashCode());
        result = prime * result + ((getPatientId() == null) ? 0 : getPatientId().hashCode());
        result = prime * result + ((getIdCardNo() == null) ? 0 : getIdCardNo().hashCode());
        result = prime * result + ((getClinicNo() == null) ? 0 : getClinicNo().hashCode());
        result = prime * result + ((getHisTradeNo() == null) ? 0 : getHisTradeNo().hashCode());
        result = prime * result + ((getMchOrderNo() == null) ? 0 : getMchOrderNo().hashCode());
        result = prime * result + ((getTotalFee() == null) ? 0 : getTotalFee().hashCode());
        result = prime * result + ((getTradeState() == null) ? 0 : getTradeState().hashCode());
        result = prime * result + ((getTradeType() == null) ? 0 : getTradeType().hashCode());
        result = prime * result + ((getTradeItem() == null) ? 0 : getTradeItem().hashCode());
        result = prime * result + ((getFeeType() == null) ? 0 : getFeeType().hashCode());
        result = prime * result + ((getRefund() == null) ? 0 : getRefund().hashCode());
        result = prime * result + ((getRefundFee() == null) ? 0 : getRefundFee().hashCode());
        result = prime * result + ((getTradeTime() == null) ? 0 : getTradeTime().hashCode());
        result = prime * result + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
        result = prime * result + ((getUpdatedAt() == null) ? 0 : getUpdatedAt().hashCode());
        result = prime * result + ((getRemark() == null) ? 0 : getRemark().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", payCenterAppId=").append(payCenterAppId);
        sb.append(", payCenterMchNo=").append(payCenterMchNo);
        sb.append(", reconConfigId=").append(reconConfigId);
        sb.append(", billDate=").append(billDate);
        sb.append(", patientName=").append(patientName);
        sb.append(", patientId=").append(patientId);
        sb.append(", idCardNo=").append(idCardNo);
        sb.append(", clinicNo=").append(clinicNo);
        sb.append(", hisTradeNo=").append(hisTradeNo);
        sb.append(", mchOrderNo=").append(mchOrderNo);
        sb.append(", totalFee=").append(totalFee);
        sb.append(", tradeState=").append(tradeState);
        sb.append(", tradeType=").append(tradeType);
        sb.append(", tradeItem=").append(tradeItem);
        sb.append(", feeType=").append(feeType);
        sb.append(", refund=").append(refund);
        sb.append(", refundFee=").append(refundFee);
        sb.append(", tradeTime=").append(tradeTime);
        sb.append(", createdAt=").append(createdAt);
        sb.append(", updatedAt=").append(updatedAt);
        sb.append(", remark=").append(remark);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}